<?php

/* @var $this yii\web\View */

$this->title = '玩客快栈';
?>
<div class="site-index">
    <?php echo $this->render('/public/top'); ?>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span6">
                <p>
                    <?php echo Yii::$app->user->identity->mobile?> 您好
                </p>
                <p>
                    余额：<?php echo
                    bcdiv(Yii::$app->user->identity->balance, 1, 3)?>
                    冻结金额：<?php echo
                    bcdiv(Yii::$app->user->identity->freeze, 1 , 3)?>
                </p>
                <p>
                    我的hash：<?php echo Yii::$app->user->identity->user_hash?>
                </p>
                <p>
                    我的邀请码：<?php echo $userExtRow->invite_code?>
                    <a href="http://wkc.com/site/register?invite_code=<?php echo $userExtRow->invite_code ?>">分享</a>
                </p>
                <h3>我要抽奖</h3>
                <p>
                    <a class="btn btn-prize" href="javascript:void(0)" role="button" data-toggle="modal">抽 奖</a>
                </p>
                <div class="alert alert-info">
                    <h4>温馨提示：</h4>
                    <p style="line-height: 28px">
                        每次抽奖将消耗10wkc，一共有三次抽奖机会，最多可以获取<br>1代的玩客猪。.
                        您还有<font style="color: red;font-weight: bold"> <?php echo 3 - $userExtRow->limit_prize?></font> 次抽奖机会
                    </p>
                </div>
            </div>
                <a href=""></a>
            </div>
        </div>
    </div>

</div>
<script type="text/javascript">
    var token = '<?php echo Yii::$app->getRequest()->getCsrfToken(); ?>';
    $(document).ready(function () {
        $('.btn-prize').click(function () {
            $.post('/prize/add', {_csrf:token},function (data) {
                if(data.code != 10000) {
                    alert(data.msg);
                    return false;
                }
                alert(data.msg);
            });
        });

    });
</script>